<?php
namespace voxfa\executor;

class ExecutorException extends \RuntimeException {
	
	protected $output;
	protected $return;
	protected $endLine;
	
	public function __construct($output,$return,$endLine,$exception = null) {
		$this->output = $output;
		$this->return = $return;
		$this->endLine = $endLine;
		
		$message = $this->formatter($output,$return,$endLine);
		parent::__construct($message,$return,$exception);
	}
	
	protected function formatter($output,$return,$endline) {
		$string = implode('',$output);
		return <<<EOF
OUTPUT: 
		{$string}
RETURN: {$return}
ENDLINE:{$endline}
EOF;
	}
	
	
	public function getStringOutput(){
		return  implode('',$this->output);
	}
	
	/**
	 * @return the $output
	 */
	public function getOutput() {
		return $this->output;
	}

	/**
	 * @return the $return
	 */
	public function getReturn() {
		return $this->return;
	}

	/**
	 * @return the $endLine
	 */
	public function getEndLine() {
		return $this->endLine;
	}
}